﻿using System;

namespace _01_Pattern
{
    //单例模式
    class Program
    {
        static void Main(string[] args)
        {
            Moto m = Moto.GetInstance();
            m.Run();
            Moto m1 = Moto.GetInstance();
            m1.Run();
        }
    }
    class Moto
    {
        static Moto m = null;
        private Moto()
        {
            //
        }
        public static Moto GetInstance()
        {
            if (m == null)
            {
                m = new Moto();
            }
            return m;
        }
        public void Run()
        {
            Console.WriteLine("笃笃笃........Moto");
        }
    }
}
